package com.ztgf.search.models.dto;

import com.ztgf.search.models.annotation.ESMappingField;
import com.ztgf.search.models.annotation.ESMappingType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(value = "商品搜索对象", description = "商品搜索对象")
@ESMappingType(typeName = "goods")
public class EsGoodsDTO implements Serializable {

    @ApiModelProperty(value = "id")
    @ESMappingField(fieldName = "id", dataType = "long")
    private Long id;

    @ApiModelProperty(value = "商品图片")
    @ESMappingField(fieldName = "logUrl", dataType = "keyword")
    private String logUrl;

    @ApiModelProperty(value = "商品名称不分词")
    @ESMappingField(fieldName = "goodsName", dataType = "keyword")
    private String goodsName;

    @ApiModelProperty(value = "商品名称-使用ik_smart分词")
    @ESMappingField(fieldName = "goodsNameIkSmart", isAnalyze = true, setAnalyzer = "ik_smart", searchAnalyzer = "ik_smart,reindex")
    private String goodsNameIkSmart;

    @ApiModelProperty(value = "商品名称-使用ik_max_word分词")
    @ESMappingField(fieldName = "goodsNameIkMaxWord", isAnalyze = true, setAnalyzer = "default")
    private String goodsNameIkMaxWord;

    @ApiModelProperty(value = "商品描述不分词")
    @ESMappingField(fieldName = "description", dataType = "keyword")
    private String description;

    @ApiModelProperty(value = "商品价格")
    @ESMappingField(fieldName = "price", dataType = "double")
    private double price;

    @ApiModelProperty(value = "原价")
    @ESMappingField(fieldName = "originalPrice", dataType = "double")
    private double originalPrice;

    @ApiModelProperty(value = "付款人数")
    @ESMappingField(fieldName = "payUserNum", dataType = "integer")
    private Integer payUserNum;

    @ApiModelProperty(value = "卖家店铺id")
    @ESMappingField(fieldName = "sellerShopId", dataType = "keyword")
    private Long sellerShopId;

    @ApiModelProperty(value = "卖家店铺名称")
    @ESMappingField(fieldName = "sellerShopName", dataType = "keyword")
    private String sellerShopName;

    @ApiModelProperty(value = "卖家店铺地址")
    @ESMappingField(fieldName = "sellerShopAddress", dataType = "keyword")
    private String sellerShopAddress;

    @ApiModelProperty(value = "品牌id")
    @ESMappingField(fieldName = "brandId", dataType = "keyword")
    private String brandId;

    @ApiModelProperty(value = "品牌名称")
    @ESMappingField(fieldName = "brandName", dataType = "keyword")
    private String brandName;

    @ApiModelProperty(value = "品牌名称-使用ik_smart分词")
    @ESMappingField(fieldName = "brandNameIkSmart", isAnalyze = true, setAnalyzer = "ik_smart")
    private String brandNameIkSmart;

    @ApiModelProperty(value = "品牌名称-使用ik_max_word分词")
    @ESMappingField(fieldName = "brandNameIkMaxWord", isAnalyze = true, setAnalyzer = "default")
    private String brandNameIkMaxWord;

    @ApiModelProperty(value = "类目id")
    @ESMappingField(fieldName = "categoryId", dataType = "keyword")
    private Long categoryId;

    @ApiModelProperty(value = "类目名称")
    @ESMappingField(fieldName = "categoryName", dataType = "keyword")
    private String categoryName;

    @ApiModelProperty(value = "是否新品推荐")
    @ESMappingField(fieldName = "isNew", dataType = "integer")
    private Integer isNew;

    @ApiModelProperty(value = "人气")
    @ESMappingField(fieldName = "popularity", dataType = "integer")
    private Integer popularity;

    @ApiModelProperty(value = "评论数量")
    @ESMappingField(fieldName = "evaluationNum", dataType = "integer")
    private Integer evaluationNum;

    @ApiModelProperty(value = "商品创建时间")
    @ESMappingField(fieldName = "createTime", dataType = "long")
    private Date createTime;

    @ApiModelProperty(value = "商品类目父级id")
    @ESMappingField(fieldName = "parentCategoryId", dataType = "keyword")
    private Long parentCategoryId;

    @ApiModelProperty(value = "商品类目一级id")
    @ESMappingField(fieldName = "firstCategoryId", dataType = "keyword")
    private Long firstCategoryId;

    @ApiModelProperty(value = "筛选属性ids")
    @ESMappingField(fieldName = "filterIds", dataType = "keyword")
    private String filterIds;

    @ApiModelProperty(value = "筛选属性名称")
    @ESMappingField(fieldName = "filterNames", dataType = "keyword")
    private String filterNames;

    @ApiModelProperty(value = "筛选属性名称")
    @ESMappingField(fieldName = "filterName", dataType = "keyword")
    private String[] filterName;

    @ApiModelProperty(value = "搜索结果匹配度")
    private float score;

    @ApiModelProperty(value = "是否询价")
    @ESMappingField(fieldName = "isXun", dataType = "keyword")
    private Integer isXun;

    @ApiModelProperty(value = "标签属性名称")
    @ESMappingField(fieldName = "labelIds", dataType = "keyword")
    private String[] labelIds;

    @ApiModelProperty(value = "商品浏览量")
    @ESMappingField(fieldName = "browseAmount", dataType = "integer")
    private Integer browseAmount;
}
